class CompanyPolicy < ApplicationPolicy
  attr_reader :user, :company

  def index?
    return true
  end

  def create?
    return true if user.role.privilege == 1
    return true if user.role.privilege == 0
  end

  def show?
    return true
  end

  def destroy?
    return true if user.role.privilege >5
  end

  def update?
    return true if user.role.privilege >5
  end

  class Scope < Scope
    def resolve
      scope.all
    end
  end

end

